package com.dime.basic.api;

import com.dime.basic.api.domain.DimeBasecomb;
import com.dime.basic.api.factory.RemoteBaseCombFallbackFactory;
import com.dime.basic.api.model.Combo;
import com.dime.basic.api.model.ComboBase;
import com.dime.basic.api.model.DimeBasicDataResult;
import com.dime.basic.api.model.HarmCombo;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteBaseCombService", value = ServiceNameConstants.DM_BASIC, fallbackFactory = RemoteBaseCombFallbackFactory.class)
public interface RemoteBaseCombService {

    @PostMapping("/basecomb/info/combos")
    public R<List<ComboBase>> getCombs(@RequestBody Combo requestBody, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/basecomb/info/combo/{combCode}")
    public R<Combo> getComb(@PathVariable("combCode") String combCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/basecomb/info/checkcombos")
    public R<DimeBasicDataResult> checkCombos(@RequestBody List<ComboBase> combos, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/basecomb/info/combos/{combCodes}")
    public R<List<ComboBase>> getCombosByCodes(@PathVariable("combCodes") String combCodes, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/basecomb/info/harms/combos/{harmids}")
    public R<List<HarmCombo>> getComboByHarmIds(@PathVariable("harmids") String[] harmids, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/basecomb/info/comboBase/{ids}")
    public R<List<DimeBasecomb>> getComboByIds(@PathVariable("ids") String[] ids);
}
